<template>
    <div>
        <ep-main-layout>
            <div slot="left">
                <lack-left-module-1 :data="leftModule1"></lack-left-module-1>
                <lack-left-module-2 style="margin-top:20px" :data="leftModule2"></lack-left-module-2>
            </div>
            <div slot="center" style="margin-left:20px">
                <second-center :data="centerData" label1="专业人员紧缺指数" :label2="'人力资源紧缺\n指数'" label3="群众演员紧缺指数" label4="配套人员紧缺指数" :table-data="jqdspopdata"></second-center>
            </div>
             <div slot="right" style="margin-left:20px">
                <lack-right-module :data="rightModule"></lack-right-module>
            </div>
        </ep-main-layout>
    </div>
</template>
<script>
import SecondCenter from '../components/active/SecondCenter.vue'
import EpMainLayout from '../components/EpMainLayout.vue'
import LackLeftModule1 from '../components/lack/LackLeftModule1.vue'
import LackLeftModule2 from '../components/lack/LackLeftModule2.vue'
import LackRightModule from '../components/lack/LackRightModule.vue'
import ModuleTitle from '../components/ModuleTitle.vue'
export default {
    components: { EpMainLayout, SecondCenter, ModuleTitle, LackLeftModule1, LackLeftModule2, LackRightModule },
    data() {
        return {
          // 紧缺度的表格弹窗数据
          jqdspopdata:{
            title:'紧缺指数：各指标实际得分*分类权重*指标权重累加',
            value:[
                {
                    type: '专业人员紧缺',
                    name: '专业人员紧缺度降低率',
                    flqz: '0.1',
                    zbqz: '1',
                    jzz: '',
                    jfgz: '紧缺度=需求数/（需求数+存量数），计算公式=（年前紧缺度-当前紧缺度）*100/(年前紧缺度*月份/12），大于100分得分为100'
                },
                {
                    type: '群众演员紧缺',
                    name: '一级群演满足度',
                    flqz: '0.6',
                    zbqz: '0.2',
                    jzz: '',
                    jfgz: '今年未满足群演需求月份占比乘以100'
                },
                {
                    type: '群众演员紧缺',
                    name: '二级群演满足度',
                    flqz: '0.6',
                    zbqz: '0.2',
                    jzz: '',
                    jfgz: '今年未满足群演需求月份占比乘以100'
                },
                {
                    type: '群众演员紧缺',
                    name: '三级群演满足度',
                    flqz: '0.6',
                    zbqz: '0.2',
                    jzz: '',
                    jfgz: '今年未满足群演需求月份占比乘以100'
                },
                {
                    type: '群众演员紧缺',
                    name: '四级群演满足度',
                    flqz: '0.6',
                    zbqz: '0.2',
                    jzz: '',
                    jfgz: '今年未满足群演需求月份占比乘以100'
                },
                {
                    type: '群众演员紧缺',
                    name: '五级群演满足度',
                    flqz: '0.6',
                    zbqz: '0.2',
                    jzz: '',
                    jfgz: '今年未满足群演需求月份占比乘以100'
                },
                {
                    type: '配套人员紧缺',
                    name: '配套人员月均服务人数',
                    flqz: '0.3',
                    zbqz: '1',
                    jzz: '80%',
                    jfgz: '今年值除以去年值等于基准值80分，高于基准值1%减1分，低于基准值1%加1分满分100'
                },

            ],
          },
            centerData: {
                rcqzhy: 0, rlzyhy: 0, rcjg: '0', rcfzhj: '0'
            },
            leftModule1: {
              value1: 0, value2: 0,
              value3: 0, value4: 0,
                list: [
                    {
                        name: '岗位1',
                        value:[0,0,0,0,0]
                    },{
                        name: '岗位2',
                        value:[0,0,0,0,0]
                    },{
                        name: '岗位3',
                        value:[0,0,0,0,0]
                    },{
                        name: '岗位4',
                        value:[0,0,0,0,0]
                    },{
                        name: '岗位5',
                        value:[0,0,0,0,0]
                }]
            },
            leftModule2: [
                [
                {
                    name: '2021-12',
                    value1: 0,
                    value2: 0
                },
                {
                    name: '2022-01',
                    value1: 0,
                    value2: 0
                },
                {
                    name: '2022-02',
                    value1: 0,
                    value2: 0
                },
                {
                    name: '2022-03',
                    value1: 0,
                    value2: 0
                },{
                    name: '2022-04',
                    value1: 0,
                    value2: 0
                }
            ],[
                {
                    name: '2021-12',
                    value1: 0,
                    value2: 0
                },
                {
                    name: '2022-01',
                    value1: 0,
                    value2: 0
                },
                {
                    name: '2022-02',
                    value1: 0,
                    value2: 0
                },
                {
                    name: '2022-03',
                    value1: 0,
                    value2: 0
                },{
                    name: '2022-04',
                    value1: 0,
                    value2: 0
                }
            ],[
                {
                    name: '2021-12',
                    value1: 0,
                    value2: 0
                },
                {
                    name: '2022-01',
                    value1: 0,
                    value2: 0
                },
                {
                    name: '2022-02',
                    value1: 0,
                    value2: 0
                },
                {
                    name: '2022-03',
                    value1: 0,
                    value2: 0
                },{
                    name: '2022-04',
                    value1: 0,
                    value2: 0
                }
            ],[
                {
                    name: '2021-12',
                    value1: 0,
                    value2: 0
                },
                {
                    name: '2022-01',
                    value1: 0,
                    value2: 0
                },
                {
                    name: '2022-02',
                    value1: 0,
                    value2: 0
                },
                {
                    name: '2022-03',
                    value1: 0,
                    value2: 0
                },{
                    name: '2022-04',
                    value1: 0,
                    value2: 0
                }
            ],[
                {
                    name: '2021-12',
                    value1: 0,
                    value2: 0
                },
                {
                    name: '2022-01',
                    value1: 0,
                    value2: 0
                },
                {
                    name: '2022-02',
                    value1: 0,
                    value2: 0
                },
                {
                    name: '2022-03',
                    value1: 0,
                    value2: 0
                },{
                    name: '2022-04',
                    value1: 0,
                    value2: 0
                }
            ]],
            rightModule: {
                list1: [
                    {
                        name: '2021-12',
                        value: 0
                    },{
                        name: '2022-01',
                        value: 0
                    },{
                        name: '2022-02',
                        value: 0
                    },{
                        name: '2022-03',
                        value: 0
                    },{
                        name: '2022-04',
                        value: 0
                }],
                value1: 1234,
                value2: 2341,
                value3: 8971,
                list2:
                    [
                    {
                    name: '配套人员类型一',
                    value: 0,
                    percent: Math.floor(Math.random() * 100),
                    numbers: Math.floor(Math.random() * 1000 + 500)
                },{
                    name: '配套人员类型二',
                    value: 0,
                    percent: Math.floor(Math.random() * 100),
                    numbers: Math.floor(Math.random() * 1000 + 500)
                },{
                    name: '配套人员类型三',
                    value: 0,
                    percent: Math.floor(Math.random() * 100),
                    numbers: Math.floor(Math.random() * 1000 + 500)
                },{
                    name: '配套人员类型四',
                    value: 0,
                    percent: Math.floor(Math.random() * 100),
                    numbers: Math.floor(Math.random() * 1000 + 500)
                },{
                    name: '配套人员类型五',
                    value: 0,
                    percent: Math.floor(Math.random() * 100),
                    numbers: Math.floor(Math.random() * 1000 + 500)
                },{
                    name: '配套人员类型六',
                    value: 0,
                    percent: Math.floor(Math.random() * 100),
                    numbers: Math.floor(Math.random() * 1000 + 500)
                },]
            }
        }
    },
    mounted() {
        this.resetData();
        setInterval(() => {
            this.resetData()
        }, 1000*60);
    },
    methods: {
        resetData() {

            let params = {
            };
            let url ='/dyrl/screen/query/jqzs'
            //let url='/jhApi/dsb/getSa02';
            console.log('调用接口');
            this.$api.commonPost(url,params).then(res=>{
                console.log('获取数据',res);
                console.log(res.data);
                console.log("code:"+res.data.code);
                if(res.data.code === 0){
                    console.log(res.data.result);
                    this.centerData=res.data.result.centerData;
                    this.leftModule1=res.data.result.leftModule1;
                    this.leftModule2 =res.data.result.leftModule2;
                    this.rightModule = res.data.result.rightModule;


                }else{
                    console.log("error:");
                    this.$message({
                        type: 'error',
                        message: res.data.code,
                        duration: 1500
                    })
                }

            })




           /* this.centerData = {
                rcqzhy: Math.floor(Math.random() * 80 + 20), rlzyhy: Math.floor(Math.random() * 80 + 20) , rcjg: Math.floor(Math.random() * 80 + 20), rcfzhj: Math.floor(Math.random() * 80 + 20)
            },
            this.leftModule1 = {
                value1: Math.floor(Math.random() * 2000 + 2000), value2: Math.floor(Math.random() * 2000 + 2000),
                value3: Math.floor(Math.random() * 2000 + 2000), value4: Math.floor(Math.random() * 2000 + 2000),
                list: [
                {
                  name: '岗位1',
                  value:[Math.floor(Math.random() *100 ),Math.floor(Math.random() *1000+1000),Math.floor(Math.random() *1000+1000),Math.floor(Math.random() *1000+1000),Math.floor(Math.random() *1000+1000)]
                },{
                  name: '岗位2',
                  value:[Math.floor(Math.random() *100 ),Math.floor(Math.random() *1000+1000),Math.floor(Math.random() *1000+1000),Math.floor(Math.random() *1000+1000),Math.floor(Math.random() *1000+1000)]
                },{
                  name: '岗位3',
                  value:[Math.floor(Math.random() *100 ),Math.floor(Math.random() *1000+1000),Math.floor(Math.random() *1000+1000),Math.floor(Math.random() *1000+1000),Math.floor(Math.random() *1000+1000)]
                },{
                  name: '岗位4',
                  value:[Math.floor(Math.random() *100 ),Math.floor(Math.random() *1000+1000),Math.floor(Math.random() *1000+1000),Math.floor(Math.random() *1000+1000),Math.floor(Math.random() *1000+1000)]
                },{
                  name: '岗位5',
                  value:[Math.floor(Math.random() *100 ),Math.floor(Math.random() *1000+1000),Math.floor(Math.random() *1000+1000),Math.floor(Math.random() *1000+1000),Math.floor(Math.random() *1000+1000)]
                }]
            },
            this.leftModule2 = [[
                {
                    name: '2021-12',
                    value1: 0,
                    value2: 0
                },
                {
                    name: '2022-01',
                    value1: 0,
                    value2: 0
                },
                {
                    name: '2022-02',
                    value1: 0,
                    value2: 0
                },
                {
                    name: '2022-03',
                    value1: 0,
                    value2: 0
                },{
                    name: '2022-04',
                    value1: 0,
                    value2: 0
                }
            ],[
                {
                    name: '2021-12',
                    value1: 0,
                    value2: 0
                },
                {
                    name: '2022-01',
                    value1: 0,
                    value2: 0
                },
                {
                    name: '2022-02',
                    value1: 0,
                    value2: 0
                },
                {
                    name: '2022-03',
                    value1: 0,
                    value2: 0
                },{
                    name: '2022-04',
                    value1: 0,
                    value2: Math.floor(Math.random() * 500 + 500)
                }
            ],[
                {
                    name: '2021-12',
                    value1: Math.floor(Math.random() * 500 + 500),
                    value2: Math.floor(Math.random() * 500 + 500)
                },
                {
                    name: '2022-01',
                    value1: Math.floor(Math.random() * 500 + 500),
                    value2: Math.floor(Math.random() * 500 + 500)
                },
                {
                    name: '2022-02',
                    value1: Math.floor(Math.random() * 500 + 500),
                    value2: Math.floor(Math.random() * 500 + 500)
                },
                {
                    name: '2022-03',
                    value1: Math.floor(Math.random() * 500 + 500),
                    value2: Math.floor(Math.random() * 500 + 500)
                },{
                    name: '2022-04',
                    value1: Math.floor(Math.random() * 500 + 500),
                    value2: Math.floor(Math.random() * 500 + 500)
                }
            ],[
                {
                    name: '2021-12',
                    value1: Math.floor(Math.random() * 500 + 500),
                    value2: Math.floor(Math.random() * 500 + 500)
                },
                {
                    name: '2022-01',
                    value1: Math.floor(Math.random() * 500 + 500),
                    value2: Math.floor(Math.random() * 500 + 500)
                },
                {
                    name: '2022-02',
                    value1: Math.floor(Math.random() * 500 + 500),
                    value2: Math.floor(Math.random() * 500 + 500)
                },
                {
                    name: '2022-03',
                    value1: Math.floor(Math.random() * 500 + 500),
                    value2: Math.floor(Math.random() * 500 + 500)
                },{
                    name: '2022-04',
                    value1: Math.floor(Math.random() * 500 + 500),
                    value2: Math.floor(Math.random() * 500 + 500)
                }
            ],[
                {
                    name: '2021-12',
                    value1: Math.floor(Math.random() * 500 + 500),
                    value2: Math.floor(Math.random() * 500 + 500)
                },
                {
                    name: '2022-01',
                    value1: Math.floor(Math.random() * 500 + 500),
                    value2: Math.floor(Math.random() * 500 + 500)
                },
                {
                    name: '2022-02',
                    value1: Math.floor(Math.random() * 500 + 500),
                    value2: Math.floor(Math.random() * 500 + 500)
                },
                {
                    name: '2022-03',
                    value1: Math.floor(Math.random() * 500 + 500),
                    value2: Math.floor(Math.random() * 500 + 500)
                },{
                    name: '2022-04',
                    value1: Math.floor(Math.random() * 500 + 500),
                    value2: Math.floor(Math.random() * 500 + 500)
                }
            ]],
            this.rightModule = {
                list1: [{
                        name: '2021-12',
                        value: Math.floor(Math.random() * 500 + 500)
                    },{
                        name: '2022-01',
                        value: Math.floor(Math.random() * 500 + 500)
                    },{
                        name: '2022-02',
                        value: Math.floor(Math.random() * 500 + 500)
                    },{
                        name: '2022-03',
                        value: Math.floor(Math.random() * 500 + 500)
                    },{
                        name: '2022-04',
                        value: Math.floor(Math.random() * 500 + 500)
                }],
                value1: Math.floor(Math.random() * 500 + 500),
                value2: Math.floor(Math.random() * 500 + 500),
                value3: Math.floor(Math.random() * 500 + 500),
                list2: [{
                    name: '配套人员类型一',
                    value: Math.floor(Math.random() * 500 + 500),
                  percent: Math.floor(Math.random() * 100),
                  numbers: Math.floor(Math.random() * 1000 + 500)
                },{
                    name: '配套人员类型二',
                    value: Math.floor(Math.random() * 500 + 500),
                  percent: Math.floor(Math.random() * 100),
                  numbers: Math.floor(Math.random() * 1000 + 500)
                },{
                    name: '配套人员类型三',
                    value: Math.floor(Math.random() * 500 + 500),
                  percent: Math.floor(Math.random() * 100),
                  numbers: Math.floor(Math.random() * 1000 + 500)
                },{
                    name: '配套人员类型四',
                    value: Math.floor(Math.random() * 500 + 500),
                  percent: Math.floor(Math.random() * 100),
                  numbers: Math.floor(Math.random() * 1000 + 500)
                },{
                    name: '配套人员类型五',
                    value: Math.floor(Math.random() * 500 + 500),
                  percent: Math.floor(Math.random() * 100),
                  numbers: Math.floor(Math.random() * 1000 + 500)
                },{
                    name: '配套人员类型六',
                    value: Math.floor(Math.random() * 500 + 500),
                  percent: Math.floor(Math.random() * 100),
                  numbers: Math.floor(Math.random() * 1000 + 500)
                },]
            }*/
        }
    }

}
</script>
<style lang="less" scoped>
.mt20 {
    margin-top: 20px;
}
</style>
